import 'package:flutter/material.dart';
import 'package:get/get.dart';

class TextStyleModel {
  /// 文字颜色
  final Color? color;

  /// 字体大小
  final double fontSize;

  TextStyleModel({this.color, required this.fontSize});

  /// 字重：regular w400
  TextStyle get regular {
    if (GetPlatform.isIOS) {
      return TextStyle(
        fontSize: fontSize,
        color: color,
        fontWeight: FontWeight.w400,
        fontFamilyFallback: const ["PingFang SC"],
      );
    } else {
      return TextStyle(
        fontSize: fontSize,
        color: color,
        fontWeight: FontWeight.w400,
      );
    }
  }

  /// 字重：medium w500
  TextStyle get medium {
    if (GetPlatform.isIOS) {
      return TextStyle(
        fontSize: fontSize,
        color: color,
        fontWeight: FontWeight.w500,
        fontFamilyFallback: const ["PingFang SC"],
      );
    } else {
      return TextStyle(
        fontSize: fontSize,
        color: color,
        fontWeight: FontWeight.w500,
      );
    }
  }

  /// 字重：medium w600
  TextStyle get semiBold {
    if (GetPlatform.isIOS) {
      return TextStyle(
        fontSize: fontSize,
        color: color,
        fontWeight: FontWeight.w600,
        fontFamilyFallback: const ["PingFang SC"],
      );
    } else {
      return TextStyle(
        fontSize: fontSize,
        color: color,
        fontWeight: FontWeight.w500,
      );
    }
  }

  /// 字重：bold w700
  TextStyle get bold {
    if (GetPlatform.isIOS) {
      return TextStyle(
        fontSize: fontSize,
        color: color,
        fontWeight: FontWeight.w700,
        fontFamilyFallback: const ["PingFang SC"],
      );
    } else {
      return TextStyle(
        fontSize: fontSize,
        color: color,
        fontWeight: FontWeight.w500,
      );
    }
  }
}
